package string;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String str = "abc123def456ghi";
        str = str.replaceAll("[0-9]+", "NUMBER");
        System.out.println(str);
        //和谐用语
        String regex = "(wqnmlgb|dsb|cnm|nc|tmd|wrsndm|djb)";
        String message = "wqnmlgb!你这个dsb,你怎么这么的nc,tmd!你个djb!";
        message = message.replaceAll(regex, "***");
        System.out.println(message);
    }
}
